Telegram Group & Telegram Channel
Обработка ошибок с помощью reportError

Стэфан Джудис рассказал про малоизвестный метод для облегчения обработки ошибок в библиотечном коде — "New in JavaScript: reportError – a method to report to global event handlers".

Для логирования ошибок на странице часто устанавливают глобальный обработчик события error. Библиотеки могут редиректить возникающие исключения в этот глобальный обработчик с помощью setTimeout, но такой код выглядит как хак. Для упрощения решения этой проблемы в платформу был добавлен специальный метод reportError:

try {
fn();
} catch (error) {
// добавление кастомной обработки исключений и
// вызов глобального обработчика
reportError(error);
}

Поддержка метода reportError есть во всех актуальных браузерах.

#js

https://www.stefanjudis.com/blog/reporterror-a-method-to-report-to-global-event-handlers/



tg-me.com/defront/1136
Create:
Last Update:

Обработка ошибок с помощью reportError

Стэфан Джудис рассказал про малоизвестный метод для облегчения обработки ошибок в библиотечном коде — "New in JavaScript: reportError – a method to report to global event handlers".

Для логирования ошибок на странице часто устанавливают глобальный обработчик события error. Библиотеки могут редиректить возникающие исключения в этот глобальный обработчик с помощью setTimeout, но такой код выглядит как хак. Для упрощения решения этой проблемы в платформу был добавлен специальный метод reportError:


try {
fn();
} catch (error) {
// добавление кастомной обработки исключений и
// вызов глобального обработчика
reportError(error);
}

Поддержка метода reportError есть во всех актуальных браузерах.

#js

https://www.stefanjudis.com/blog/reporterror-a-method-to-report-to-global-event-handlers/

BY Defront — про фронтенд-разработку и не только




Share with your friend now:
tg-me.com/defront/1136

View MORE
Open in Telegram


Defront при поддержке Зарплата ру — про фронтенд разработку и не только Telegram | DID YOU KNOW?

Date: |

What is Telegram Possible Future Strategies?

Cryptoassets enthusiasts use this application for their trade activities, and they may make donations for this cause.If somehow Telegram do run out of money to sustain themselves they will probably introduce some features that will not hinder the rudimentary principle of Telegram but provide users with enhanced and enriched experience. This could be similar to features where characters can be customized in a game which directly do not affect the in-game strategies but add to the experience.

What is Secret Chats of Telegram

Secret Chats are one of the service’s additional security features; it allows messages to be sent with client-to-client encryption. This setup means that, unlike regular messages, these secret messages can only be accessed from the device’s that initiated and accepted the chat. Additionally, Telegram notes that secret chats leave no trace on the company’s services and offer a self-destruct timer.

Defront при поддержке Зарплата ру — про фронтенд разработку и не только from fr


Telegram Defront — про фронтенд-разработку и не только
FROM USA